package cn.doit.scala.day01.method

/**
 * @DATE 2021/12/24/17:36
 * @Author MDK
 * @Version 2021.2.2
 * */
object C03_Test04 {
  def opt(x:Int, f:Int=>Int): Int ={
    f(x)
  }
  def opt(x:Int, y:Int, f:(Int, Int)=>Int):Int={
    f(x,y)
  }

  def main(args: Array[String]): Unit = {
    val res: Int = opt(12, _ * 10)
    println(res)

    val i: Int = opt(2, 3, _ * _)
    println(i)
  }
}
